package com.sdkx.app.model;

import org.litepal.LitePal;

import java.util.ArrayList;
import java.util.List;

public class AirSpace extends  ViewObject{
    int id;
    public boolean visible;
    int type;
    private List<AirSpacePoint> points = new ArrayList<>();
    AirSpaceGeneral general;
    public static final int TYPE_ROUND = 0;
    public static final  int TYPE_POLYGON = 1;
    int linecolor;
    int linewidth;

    public int getLinecolor() {
        return linecolor;
    }

    public void setLinecolor(int linecolor) {
        this.linecolor = linecolor;
    }

    public int getLinewidth() {
        return linewidth;
    }

    public void setLinewidth(int linewidth) {
        this.linewidth = linewidth;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public boolean isVisible() {
        return visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    public AirSpaceGeneral getGeneral() {
        return general;
    }

    public void setGeneral(AirSpaceGeneral general) {
        this.general = general;
    }

    public List<AirSpacePoint> getPoints() {
        return points;
    }
    public List<AirSpacePoint>getPointsIndb(){
        String condition = this.getClass().getSimpleName().toLowerCase()+"_id="+id;
        points = LitePal.where(condition).find(AirSpacePoint.class);
        return points;
    }
    public void setPoints(List<AirSpacePoint> points) {
        this.points = points;
    }
}
